﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GoodItemSelect.ascx.cs" Inherits="Controls_Activity_GoodItemSelect" %>
<asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup" Width="750px">
    <asp:Panel ID="Panel2" runat="server" CssClass="modalPopupHeader">
        <div>&nbsp;&nbsp;&nbsp;<asp:Literal ID="literalModalPopup" runat="server"></asp:Literal></div>
    </asp:Panel>
        <div style="padding:2px; height:450px;">
        <asp:UpdatePanel runat="server" ID="UpdatePanel1">
            <ContentTemplate>
            <div class="searchDiv" > 
             <table cellspacing="0" class="searchTable" style="margin-top:10px; margin-left:10px;">
                <tr>
                    <td>
                    仓库：
                    </td>
                    <td>
                    <div class="select"><div><ofcc:DropDownList ID="S_Storage" runat="server"></ofcc:DropDownList></div></div>
                    &nbsp;&nbsp;
                    </td>
                    <td>
                    组别：
                    </td>
                    <td>
                   <div class="select"><div><ofcc:DropDownList ID="S_GroupCode" runat="server" ></ofcc:DropDownList></div></div>
                    &nbsp;&nbsp;
                    </td>
                    <td rowspan="2">
                        &nbsp;&nbsp;<asp:Button ID="btnSearch" UseSubmitBehavior="false" runat="server" OnClick="btnSearchGood_Click" Text=" 查询 "  CssClass="searchButton" />
                    </td>
                </tr>
                <tr>
                    <td>
                    物料编号：
                    </td>
                    <td>
                    <asp:TextBox ID="S_GoodsCode" runat="server" CssClass="smallInput" MaxLength="64" ></asp:TextBox>
                    </td>
                    <td>
                    物料名称：
                    </td>
                    <td>
                    <asp:TextBox ID="S_Subject" runat="server" CssClass="smallInput" MaxLength="64" ></asp:TextBox>
                    </td> 
                </tr>
             </table> 
             </div>
             <table class="centerTable" style="width:100%">
                <tr>
                    <td style="width:230px;">
                        <div class="webPanelBorder" style="text-align:left; font-weight:normal;">
                            <asp:Panel ID="Panel4" runat="server" Width="230px" Height="400px" ScrollBars="Auto">
                                <asp:TreeView ID="treeView" runat="server" OnSelectedNodeChanged="treeView_SelectedNodeChanged">
                                    <NodeStyle ImageUrl="~/App_Themes/DefaultSkin/ImageTree/folder.gif" />
                                    <SelectedNodeStyle BackColor="Silver" Font-Bold="True" />
                                </asp:TreeView>               
                            </asp:Panel>                
                        </div>
                    </td>
                    <td>
                        <ofcc:GridView ID="gridViewSelectItems" runat="server" AutoGenerateColumns="False" 
                            onsplitpageindexchange="gridViewSelectItems_SplitPageIndexChange" OnRowDataBound="gridViewSelectItems_RowDataBound">
                            <Columns>
                                <asp:TemplateField HeaderText="选择">
                                    <ItemTemplate>
                                        <asp:HiddenField ID = "HiddenField2" runat="server" Value='<%#Eval("GoodsID") %>' />
                                        <input runat="server" ID="Check_GoodsID" name="Check_GoodsID" type="checkbox" value='<%#DataBinder.Eval(Container.DataItem,"GoodsID")%>' />
                                    </ItemTemplate>
                                    <HeaderStyle Width="40px" />
                                </asp:TemplateField>
                                <asp:HyperLinkField DataTextField="GoodsCode" HeaderText="物料编号" NavigateUrl="#" Target="_blank"/> 
                                <asp:BoundField DataField="Subject" HeaderText="物料名称" />
                                <asp:BoundField DataField="CategoryName" HeaderText="物料类型" />
                                <asp:BoundField DataField="GoodsMaker" HeaderText="品牌厂商" />
                                <asp:BoundField DataField="TypeModel" HeaderText="规格型号" />
                                <asp:BoundField DataField="GoodsUnit" HeaderText="单位" />
                                <asp:BoundField DataField="ActiveCount" HeaderText="库存数量" />
                            </Columns>
                            </ofcc:GridView> 
                    </td>
                </tr>
            </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        </div>
        <div class="modalPopupFooter">
             <asp:LinkButton ID="btnModalPopupOK" runat="server" 
                OnClientClick="_modalPopupHide101()" onclick="btnModalPopupOK_Click" >确定</asp:LinkButton>
             <asp:LinkButton ID="btnModalPopupCancel" runat="server" 
                OnClientClick="_modalPopupHide101();return false;" >取消</asp:LinkButton>
             <p style="display:none"><ofcc:LinkButton ID="btnModalPopupNone" 
                runat="server" >None Event</ofcc:LinkButton></p>
        </div>

<asp:HiddenField ID="hfModalPopup" runat="server" />
<ajax:ModalPopupExtender runat="server" ID="modalPopup"    
    PopupControlID="Panel1" 
    PopupDragHandleControlID="Panel2"
    TargetControlID="btnModalPopupNone"
    BackgroundCssClass="modalBackground"
    BehaviorID="_99modalPopupBehavior" 
    DropShadow="True"
    >    
</ajax:ModalPopupExtender>
<script type="text/javascript">
    function pageLoad() {
        $addHandler($get('<%=btnModalPopupCancel.ClientID.ToString() %>'), 'click', _modalPopupHide101);
    }

    function modalPopupShow(ev) {
        ev.preventDefault();
        var modalPopupBehavior = $find('modalPopupBehavior');
        modalPopupBehavior.show();
    }

    function _modalPopupHide101(ev) {
        //fix firefox
        $get('<%=Panel1.ClientID.ToString() %>').style.display = "none";
        if ($get('<%=Panel1.ClientID.ToString() %>_DropShadow') != null)
            $get('<%=Panel1.ClientID.ToString() %>_DropShadow').style.display = "none";
        var divList = $$('div.modalBackground');
        divList[0].style.display = "none";
        if(ev)
            ev.preventDefault();        
        var modalPopupBehavior = $find('_99modalPopupBehavior');
        modalPopupBehavior.hide();
    }
</script>
</asp:Panel>  
